#ifndef H_A2GRDEF
#define H_A2GRDEF

typedef struct {
   BYTE adap1;  /* video adapter type */
   BYTE disp1;  /* display type */
   BYTE adap2;  /* video adapter type */
   BYTE disp2;  /* display type */
} VSYS;

/* video adapters (VSYS.adap?) */
#define _NONE    0x00    /* no video adapter */
#define _MDA     0x01    /* IBM Monochrome Display Adapter */
#define _CGA     0x02    /* Color Graphic Adapter */
#define _HGC     0x03    /* Herculles Graphic Controller */
#define _HGCPLUS 0x04    /* Herculles Plus Graphic Controller */
#define _INCOLOR 0x05    /* Herculles with InColor card */
#define _PGC     0x06    /* Professional Graphic Controller */
#define _EGA     0x07    /* Enhanced Graphic Adapter */
#define _VGA     0x08    /* Video Graphic Array */
#define _MCGA    0x09    /* Multi Color Graphic Adapter */
#define _AUNKN   0xFF    /* Unknown video adapter */

/* display type (VSYS.disp?) */
#define _MONO    0x01    /* monochrome display */
#define _COLOR   0x02    /* color display */
#define _ECOLOR  0x03    /* enhanced color display */
#define _AMONO   0x04    /* analog monochrome display */
#define _ACOLOR  0x05    /* analog color display */

/*----- a2grdef.h --common used types and constants from "a2tv0pc"--*/
typedef struct {
   short ncols;           /* columns on screen */
   short nrows;           /* rows on screen    */
   short hight;           /* char height       */
   short color;           /* colors for current mode */
   short npage;           /* number screen pages     */
   short flags;           /* flags for current mode  */
} MDESC;

/*------------- masks for flags -------------*/
#define F_TEXT 0x01 /* set - text mode       */
#define F_GRPH 0x02 /* set - graphic mode    */
#define F_COLO 0x04 /* set - color mode      */
#define F_MONO 0x08 /* set - monochrome mode */
#define F_HERC 0x10 /* set - herculles mode  */
#define F_ENBL 0x20 /* set - mode available  */

#define MAX_COL 132
#define MAX_ROW 60
#define LIN_MAX (MAX_COL*2)
#define CLM_MAX (MAX_COL*2)

#if defined(__FOR_DOS__) || defined(__FOR_DPMI16__)
typedef struct {
   short sign;
   short begX,begY;
   short nCol,nRow;
   short nChH,nChW;
   short iFgr,iBgr;
   short hMem;
} GrW;
# endif

/*----- video modes -----*/
#define TEXTBW40      0x00
#define TEXTC40       0x01
#define TEXTBW80      0x02
#define TEXTC80       0x03
#define MRES4COLOR    0x04
#define MRES2COLOR    0x05
#define HRES2COLOR    0x06
#define TEXTMONO      0x07
#define HERCMONO      0x08
#define HERCCOLOR     0x09
#define TEXTMAX80     0x0A
#define TEXT25X132    0x0B
#define TEXTMAX132    0x0C
#define MRES16COLOR   0x0D
#define HRES16COLOR   0x0E
#define ERES4COLOR    0x0F
#define ERES16COLOR   0x10
#define VRES2COLOR    0x11
#define VRES16COLOR   0x12
#define MRES256COLOR  0x13

#define MAX_VMODE     0x13
#define NVIDEOMODES   0x14

#endif /* H_A2GRDEF */
